package com.line.api;

import com.line.model.pojo.ErrorResponse;
import com.line.model.pojo.ExpressSearchPojo;
import com.line.model.pojo.ExpressSendPojo;
import com.line.service.ExpressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "物流模块")
@RequestMapping("/express")
public class ExpressController {

	@Autowired
	private ExpressService expressService;

	@GetMapping("/send")
	@ApiOperation(value = "发货", notes = "由发快递方调用")
	public ErrorResponse send(ExpressSendPojo pojo) {
		return expressService.send(pojo);
	}

	@GetMapping("/search")
	@ApiOperation(value = "查询", notes = "通过手机号查询物流信息")
	public List<ExpressSearchPojo> search(String phone) {
		return expressService.search(phone);
	}
}
